﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Newtonsoft.Json;

namespace GenesisDemo.Helper
{
    public class Config<T> where T : class, new()
    {
        /// <summary>
        /// 配置信息
        /// </summary>
        public T Data { get; set; }

        /// <summary>
        /// 读取配置
        /// </summary>
        /// <param name="configFilePath">配置文件路径</param>
        public Config(string configFilePath = "./appsettings.json")
        {
            Data = JsonConvert.DeserializeObject<T>(File.ReadAllText(configFilePath));
        }
    }
}
